<template>
    <Modal
            class-name="vertical-center-modal"
            v-model="modal"
            :title="title">
        <div>
            <slot name='header'></slot>
            <Form :model="info" :label-width="80" action="javascript:void(0)">
                <FormItem label="公司名称" prop='processing_results'>
                    <i-input v-model="info.org" placeholder="请输入要更改的公司名称名称"></i-input>
                </FormItem>
            </Form>
        </div>
        <div slot="footer">
            <button class="btn btn-danger" type="button" @click='cancel'>取消</Button>
            <btn-submit class="btn btn-success" type="submit" :p-click="ok">确定</btn-submit>
        </div>
    </Modal>
</template>
<script>
    import serCustomer from '../../serves/api-customer'
    const setDataDef = {
        org:'',
        ids:[]
    };
    export default{
        props:{
        },
        data () {
            return {
                modal:false,
                info:{},
            }
        },
        computed:{
            title(){
                return '批量修改选中参会人员公司名称'
            },
        },
        methods: {
            handleOpen(data){
                this.info = Object.assign({},setDataDef,data);
                this.$set(this,'modal',true);
            },
            cancel () {
                this.$emit('on-change',false);
                this.$set(this,'modal',false);
            },
            async ok () {
                const res =await serCustomer.setOrgMore({
                    ids:this.info.ids,
                    org:this.info.org,

                });
                if(res.code==1){
                    this.$emit('on-change',true);
                    this.$Message.success(res.message);
                    this.$set(this,'modal',false);
                    return true;
                }else{
                    this.$Message.error(res.message);
                    return false;
                }
            },

        },
        components:{
        }
    }
</script>